Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Aldotd12/bot_whatsapp/llms.txt
Use this file to discover all available pages before exploring further.
Common Issues
This guide covers the most common problems you may encounter when setting up and running the WhatsApp Attendance Bot.Messages Sent at Wrong Time
Symptoms
- Bot sends messages at unexpected times
- Check-in sent when you expected check-out, or vice versa
- Messages arrive hours before or after the intended time
Causes
Timezone Mismatch
Timezone Mismatch
GitHub Actions runs on UTC time, but your local timezone may be different.Solution:Example for EST (UTC-5):Example for IST (UTC+5:30):
- Identify your timezone offset from UTC
- Calculate the correct cron schedule
- Update
.github/workflows/main.yml
Incorrect Time Logic in bot.py
Incorrect Time Logic in bot.py
The function at This means:
bot.py:13 uses a simple hour comparison:- Hours 0-17 UTC: Check-in message
- Hours 18-23 UTC: Check-out message
Missing GitHub Secrets
Symptoms
- Workflow runs but fails with errors
- API returns 401 Unauthorized or 400 Bad Request
- Python errors:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Cause
One or more required secrets are not configured in your GitHub repository.Solution
GitHub Secrets are case-sensitive. Ensure you use the exact names:
INSTANCE_ID, TOKEN, and GROUP_ID.- Go to your repository on GitHub
- Click Settings > Secrets and variables > Actions
- Verify these three secrets exist:
INSTANCE_IDTOKENGROUP_ID
- If any are missing, click New repository secret and add them
- Re-run the workflow
How to Verify Secrets
Add a debug step to your workflow (remove after testing):Ultramsg API Errors
HTTP 401 Unauthorized
Cause: Invalid or expired TOKEN Solution:- Log in to Ultramsg Dashboard
- Navigate to your instance
- Copy the correct token
- Update the
TOKENsecret in GitHub
HTTP 400 Bad Request
Cause: Invalid GROUP_ID format or parameters Solution:- Verify GROUP_ID format:
[country_code][number]@g.us- Example:
521234567890@g.us(Mexico) - Must include
@g.ussuffix for groups
- Example:
- Use the group’s phone number, not a personal number
- Update the
GROUP_IDsecret with the correct format
HTTP 429 Too Many Requests
Cause: Exceeded Ultramsg rate limits Solution:- Check your Ultramsg plan limits
- Ensure you’re not running the workflow too frequently
- Consider upgrading your Ultramsg plan
HTTP 500 Internal Server Error
Cause: Ultramsg service issue Solution:- Check Ultramsg status page
- Wait and try again later
- Contact Ultramsg support if issue persists
Workflow Not Triggering
Symptoms
- Scheduled time passes but workflow doesn’t run
- No workflow runs appear in the Actions tab
Causes and Solutions
Inactive Repository
Inactive Repository
Cause: GitHub disables scheduled workflows in repositories with no activity for 60 days.Solution:
- Make a commit to the repository (can be a simple README update)
- Push the commit to GitHub
- The schedule will resume
workflow_dispatch trigger to run manually.Incorrect Cron Syntax
Incorrect Cron Syntax
Cause: Invalid cron expression in Common mistakes:
.github/workflows/main.ymlSolution:Verify your cron syntax:- Using 12-hour format:
cron: '0 3 * * 1-5'for 3 PM (should be15) - Wrong day range:
cron: '0 15 * * 1-7'(should be1-5for weekdays)
Workflow File Not in Correct Location
Workflow File Not in Correct Location
Cause: Workflow file is not in
.github/workflows/ directorySolution:Ensure your workflow file is at: .github/workflows/main.ymlGitHub Actions Disabled
GitHub Actions Disabled
Cause: Actions are disabled for the repositorySolution:
- Go to repository Settings > Actions > General
- Under “Actions permissions”, select Allow all actions
- Save the settings
Message Not Received in WhatsApp
Symptoms
- Workflow runs successfully (status 200)
- No message appears in WhatsApp group
Causes and Solutions
WhatsApp Instance Not Connected
WhatsApp Instance Not Connected
Cause: Your Ultramsg instance is not connected to WhatsAppSolution:
- Log in to Ultramsg Dashboard
- Check instance connection status
- If disconnected, scan the QR code to reconnect
- Keep the browser tab open until connection is established
Wrong Group ID
Wrong Group ID
Cause: GROUP_ID doesn’t match your WhatsApp groupSolution:
- Send a message to your group from WhatsApp Web
- In Ultramsg dashboard, go to Chats
- Find your group and copy its ID
- Update the
GROUP_IDsecret in GitHub
521234567890@g.usBot Not Added to Group
Bot Not Added to Group
Cause: The phone number linked to your Ultramsg instance isn’t in the groupSolution:
- Add the phone number (linked to Ultramsg) to the WhatsApp group
- Ensure it has permission to send messages
- Test by running the workflow manually
Python Dependencies Error
Symptoms
- Workflow fails with:
ModuleNotFoundError: No module named 'requests'
Cause
Therequests library is not installed before running the script.
Solution
Verify your workflow includes the install step at.github/workflows/main.yml:23-24:
requirements.txt file:
Manual Testing
Test the Workflow Manually
The workflow includesworkflow_dispatch trigger at .github/workflows/main.yml:9:
- Go to Actions tab in your repository
- Select Registro WhatsApp Automático workflow
- Click Run workflow button
- Select branch and click Run workflow
Test the Script Locally
Getting Help
If you’re still experiencing issues:- Check the Actions tab for detailed error logs
- Review Ultramsg dashboard for API logs and errors
- Verify all three secrets are correctly set
- Test with
workflow_dispatchbefore relying on the schedule